//按unicode码值比较字符串的大小
public class Wordbook {
    public static void main(String[] args) {
        String s1="b";
        String s2="a";
        String s3="c";
        String s4="b";
        System.out.println(s1+" compareTo "+s2+" :"+s1.compareTo(s2));//s1在后，返回正整数
        System.out.println(s1+" compareTo "+s3+" :"+s1.compareTo(s3));//s1在前，返回负整数
        System.out.println(s2+" compareTo "+s3+" :"+s2.compareTo(s3));//s2在前，返回负整数
        System.out.println(s1+" compareTo "+s4+" :"+s1.compareTo(s4));//相等位置，返回0
    }
}
